home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / text / tex / amiweb2c.lha / AmiWeb2c-2.1 / texmf / pastex / rexx / RequestFile.mg < prev    next >
Encoding:
Text File  |  1997-02-09  |  981 b   |  40 lines

  1. /*
  2. ** Just for grins - go get a file name via the ARP file requrester,
  3. ** and then load the file.
  4. */
  5.  
  6. /*
  7. ** Add the library
  8. */
  9. If ~Show('Libraries','rexxarplib.library') Then
  10.   If ~addlib('rexxarplib.library', 0, -30, 0) Then Do
  11.     Call Log 1, "No rexxarp library, exiting!"
  12.     Exit 20
  13.   End
  14.  
  15. NEWFILE = GetFile(20,20,Pragma('Directory'),'','Find File?')
  16.  
  17. /*
  18. ** Check for CANCEL or no file selected
  19. */
  20. If NEWFILE = "" Then
  21.   Exit 2
  22.  
  23. /*
  24. ** Check for directory selected, in which case I die (no dired). Those who
  25. ** use may wish to invoke it at this point.
  26. */
  27. If Index("/:",Right(NEWFILE, 1)) ~= 0 Then
  28.   Exit 1
  29.  
  30. /*
  31. ** Finally, do a find-file. I use this for pedegogical reasons; those
  32. ** who really want requesters everywhere might want to copy this file,
  33. ** and change the command/hailstring for other commands (or maybe create
  34. ** a single Rexx script that takes two arguments, the hailstring & command,
  35. ** and uses this in the appropriate places.
  36. */
  37. 'find-file' NEWFILE
  38.  
  39. Exit RC
  40.